<%-- 
  - Author: Neha Chauhan
  - Date: 1-Mar-'2011
  - Copyright Notice: TRAKHEES
  - Description: index.jsp
 --%>

<%@page import="org.apache.tiles.util.URLUtil"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="java.net.URLDecoder"%>
<%@page import="ae.pcfc.etks.online.itworx.ehs.web.util.UtilCommon" %>
<%@page import="ae.pcfc.etks.online.web.ViewUtils" %>
	

<html>
<head>

<sec:authorize access="hasRole('ROLE_EHS_ADMIN')">
	<meta http-equiv="refresh"
		content="0; url= <c:url value='/admin/manageDocument.htm?type=manageDocument'/>">
</sec:authorize>

<sec:authorize access="hasRole('ROLE_FNP_ADMIN')">
	<meta http-equiv="refresh"
		content="0; url= <c:url value='/admin/fnpMapping.htm?type=feesMapping'/>">
</sec:authorize>

<sec:authorize access="hasRole('ROLE_EHS_OFFICER')">
	<meta http-equiv="refresh"
		content="0; url= <c:url value='/officer/viewInbox.htm?type=inbox'/>">
</sec:authorize>

<sec:authorize access="hasRole('ROLE_EHS_CUSTOMER')">
	<meta http-equiv="refresh"
		content="0; url= <c:url value='/client/viewInbox.htm?type=inbox'/>">
</sec:authorize>

<sec:authorize access="not hasAnyRole('ROLE_EHS_ADMIN','ROLE_FNP_ADMIN','ROLE_EHS_OFFICER','ROLE_EHS_CUSTOMER')">
	<%

		String adminCtx = UtilCommon.getGeneralMapValue("adminContextPath");
		String serverURL = UtilCommon.getGeneralMapValue("serverURL");
		String requestedPage = ViewUtils.getCurrentRequestedPage(request);
		
		
		//String url="/"+adminCtx+"/login.htm?error=2&redirect="+URLEncoder.encode(serverURL + requestedPage, "UTF-8");
		String url="/"+adminCtx+"/login.htm?error=2&redirect="+URLEncoder.encode(requestedPage, "UTF-8");
		
		response.sendRedirect(url);
	
	%>
</sec:authorize>
</head>
</html>